package start;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        AbstractApplicationContext  context = new ClassPathXmlApplicationContext("META-INF/beans.xml"); 
        ConfigurableBeanFactory beanFactory = context.getBeanFactory();
        beanFactory.addBeanPostProcessor(new MyBeanPostProcessor());
        //I a = (I) context.getBean("aBean3");
        
        FactoryBean factoryBean =  (FactoryBean) context.getBean("&myFactoryBean");
        try {
            System.out.println(factoryBean.getObject());
        } catch (Exception e) {
        }
    }
}
